package cn.me.alphamq.common.entity.req;

import cn.me.alphamq.common.entity.BaseMsg;
import cn.me.alphamq.common.enumeration.TxMsgFlagEnum;

/**
 * 事务回调检查的请求，来自 broker
 *
 * @author f
 */
public class TxCallbackCheckReq extends BaseMsg {

    /**
     * 消息的主题
     */
    private String topic;

    /**
     * 放入消息的队列 id，默认值是 -1，如果没有传递，则会在写入数据时默认写到 0 号队列
     */
    private int queueId;

    /**
     * 消息的主体
     */
    private byte[] body;

    /**
     * 事务的标志
     *
     * @see TxMsgFlagEnum
     */
    private int txFlag;

    /**
     * 事务的状态
     *
     * @see cn.me.alphamq.common.enumeration.LocalTxStateEnum
     */
    private int transactionState;

    /**
     * 能够唯一标识生产者的 id
     */
    private String producerId;

    public TxCallbackCheckReq() {
    }

    public TxCallbackCheckReq(String msgId, String topic, int queueId, byte[] body,
                              int txFlag, int transactionState, String producerId) {
        super(msgId);
        this.topic = topic;
        this.queueId = queueId;
        this.body = body;
        this.txFlag = txFlag;
        this.transactionState = transactionState;
        this.producerId = producerId;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public int getQueueId() {
        return queueId;
    }

    public void setQueueId(int queueId) {
        this.queueId = queueId;
    }

    public byte[] getBody() {
        return body;
    }

    public void setBody(byte[] body) {
        this.body = body;
    }

    public int getTxFlag() {
        return txFlag;
    }

    public void setTxFlag(int txFlag) {
        this.txFlag = txFlag;
    }

    public int getTransactionState() {
        return transactionState;
    }

    public void setTransactionState(int transactionState) {
        this.transactionState = transactionState;
    }

    public String getProducerId() {
        return producerId;
    }

    public void setProducerId(String producerId) {
        this.producerId = producerId;
    }
}
